Skip to content

feat: split out docs/react routes from shared MdxRoute file#1222

Closed
jderochervlk wants to merge 2 commits intomasterfrom
vlk/split-out-docs-react
Closed

feat: split out docs/react routes from shared MdxRoute file#1222
jderochervlk wants to merge 2 commits intomasterfrom
vlk/split-out-docs-react

Conversation

@jderochervlk
Copy link
Copy Markdown
Collaborator

@jderochervlk jderochervlk commented Apr 3, 2026

  • Create DocsReactRoute.res/.resi for /docs/react/* pages, following the same pattern as DocsManualRoute with React-specific sidebar categories (Overview, Main Concepts, Hooks & State Management, Guides) and breadcrumbs (Docs > rescript-react)
  • Register docsReactRoutes in app/routes.res via MdxFile.scanPaths and filter docs/react paths out of the legacy mdxRoutes
  • Fix inconsistent comparator in Mdx.sortSection: items with an order field now always sort before items without one, and items without order preserve their relative position (was _ => -1.0, now handles all four cases explicitly)

Note

This work was done with AI assistance

- Create DocsReactRoute.res/.resi for /docs/react/* pages, following the
  same pattern as MdxRoute with React-specific sidebar categories
  (Overview, Main Concepts, Hooks & State Management, Guides) and
  breadcrumbs (Docs > rescript-react)
- Register docsReactRoutes in app/routes.res via MdxFile.scanPaths and
  filter docs/react paths out of the legacy mdxRoutes
- Fix inconsistent comparator in Mdx.sortSection: items with an order
  field now always sort before items without one, and items without order
  preserve their relative position
@jderochervlk jderochervlk changed the base branch from vlk/split-out-docs-manual to master April 9, 2026 13:47
@jderochervlk jderochervlk force-pushed the vlk/split-out-docs-react branch from 5bbdac3 to 1e11df4 Compare April 9, 2026 13:48
@jderochervlk jderochervlk marked this pull request as ready for review April 9, 2026 13:48
@github-actions
Copy link
Copy Markdown

Cloudflare deployment

Deployement ID: 9e481ca6-d2d8-4c57-8dad-54c02bad1b68
Deployment Environment: preview

⛅️ wrangler 4.63.0 (update available 4.81.1)
─────────────────────────────────────────────
✨ Compiled Worker successfully
Uploading... (7351/7845)
Uploading... (7516/7845)
Uploading... (7681/7845)
Uploading... (7845/7845)
✨ Success! Uploaded 494 files (7351 already uploaded) (4.90 sec)

✨ Uploading _redirects
✨ Uploading Functions bundle
🌎 Deploying...
✨ Deployment complete! Take a peek over at https://9e481ca6.rescript-lang.pages.dev
✨ Deployment alias URL: https://vlk-split-out-docs-react.rescript-lang.pages.dev

jderochervlk added a commit that referenced this pull request Apr 12, 2026
- Delete MdxRoute.res/.resi (all pages now handled by split routes)
- Remove react-router-mdx from package.json and delete yarn patch
- Remove react-router-mdx externals from Mdx.res
- Remove mdxRoutes binding from ReactRouter.res
- Remove react-router-mdx init from react-router.config.mjs and generate-route-types.mjs
- Add DocsManualRoute for /docs/manual pages with sidebar and TOC
- Add DocsReactRoute for /docs/react pages with sidebar and TOC
- Add SyntaxLookupDetailRoute for /syntax-lookup/* detail pages
- Add SidebarHelpers module for shared sidebar nav/category generation
- Add MdxFile.loadAllAttributes to replace react-router-mdx loadAllMdx
- Migrate BlogRoute to use MdxFile.loadAllAttributes
- Migrate SyntaxLookupRoute to use MdxFile.loadAllAttributes
- Migrate CommunityRoute to use SidebarHelpers and MdxFile.loadAllAttributes
- Fix Mdx.sortSection comparator to handle all cases explicitly
- Update routes.res to register all split routes and remove mdxRoutes

Combines PRs #1221, #1222, #1225, #1227
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant